package com.liss.basiccore;

/**
 * 使用-Xss参数减少栈内存容量：-Xss128k
 */
public class JavaVMStackSOF {
    private int stackLength =1;
    public void stackLeak(){
        stackLength++;
        stackLeak();
    }

    public static void main(String[] args) {
        JavaVMStackSOF oom = new JavaVMStackSOF();
        try{
            oom.stackLeak();
        }catch (Exception e){
            System.out.println("stack length:" + oom.stackLength);
            throw e;
        }
    }
}
